#ifndef IMAGEVIEW_H
#define IMAGEVIEW_H

#include <opencv2/core/core.hpp>
#include <QGraphicsView>
#include <QGraphicsScene>
#include <QMutex>



class ImageView : public QGraphicsView
{
    Q_OBJECT
public:
    explicit ImageView(QWidget *parent = 0);
    
signals:
    
public slots:

public:
     void showImage(cv::Mat& img);
     void showSelectedRect(cv::Point2i top_left, cv::Point2i bottom_right, cv::Scalar color = cv::Scalar(255, 0, 0));
     void clearSelected();
private:
    QImage IplImage2QImage(const IplImage *iplImage);

    QGraphicsScene* m_scene;

    QMutex m_mutex;

    cv::Mat m_img;



};

#endif // IMAGEVIEW_H
